﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PDX.ChangeTracking
{
    /// <summary>
    /// Attaches a <see cref="SnapshotReporter"/> to an <see cref="Editor"/>.
    /// </summary>
    public class SnapshotReporterAttacher : IAttacher<Element>
    {
        /// <summary>
        /// Attaches a <see cref="SnapshotReporter"/> to an <see cref="Editor"/>.
        /// </summary>
        /// <param name="target">The target.</param>
        public void Attach(Element target)
        {
            var editor = target as Editor;
            if (editor != null)
            {
                var locator = new SnapshotHandlerLocator(editor);
                var recorder = new DelegatingSnapshotHandler(locator);
                var tracker = new SnapshotReporter(editor, recorder);
            }
        }
    }
}
